#ifndef LOG_CC
#define LOG_CC
#include<string>
#include<fstream>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<iterator>
#include<vector>
#include<map>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include "def.hpp"
#include "utils.hpp"
#include "log.hpp"

using namespace std;

namespace Puza{

  Logger::Logger(){
    log_file_name = PuzaDEF::Instance()->output_file_name + ".log";
  }
  
  string Logger::GetCurrentTime(){
    time_t rawtime;
    time(&rawtime);
    return ctime(&rawtime);
  }
  
  void Logger::PutString(string s){
    PuzaDEF::Instance()->LogFile << s << " " << GetCurrentTime();  
    PuzaDEF::Instance()->LogFile.flush();
  }
  
  void Logger::Start(){
    PuzaDEF::Instance()->LogFile.open(log_file_name.c_str());
    PutString("Starting Puza Topic Modeling.");
  }
  
  
  
  void Logger::End(){
    PutString("Completed.");
    PuzaDEF::Instance()->LogFile.close();
  }
};
#endif
